include Makefile 

item.taxall: item.ridx
	pypy python/make_itemtax.py item.ridx item.taxall

user.apm60: rec_log_train.ridx rec_log_test.ridx
	cpp/mkUserAPM rec_log_train.ridx rec_log_test.ridx user.apm60 60

rec_log_train.weekclock: rec_log_train.txt
	pypy python/convertWeekClock.py $+ $@

rec_log_test.weekclock: rec_log_test.txt
	pypy python/convertWeekClock.py $+ $@

user.actwk: rec_log_train.ridx rec_log_test.ridx rec_log_train.weekclock rec_log_test.weekclock
	cpp/mkUserActWeek rec_log_train.ridx rec_log_test.ridx rec_log_train.weekclock rec_log_test.weekclock user.actwk

user.stats: user_profile.ridx user_sns.ridx train.ridx 
	pypy python/gen_user_stats.py $+ $@


item.cat3: item.ridx
	pypy python/make_catmap.py item.ridx item.cat3 3

item.cat2: item.ridx
	pypy python/make_catmap.py item.ridx item.cat2 2

features/train.group.cath2: item.cat2 user_sns.ridx train.group
	cpp/mkCatHist $+ $@
features/test.group.cath2: item.cat2 user_sns.ridx test.group
	cpp/mkCatHist $+ $@

features/train.group.cath3: item.cat3 user_sns.ridx train.group
	cpp/mkCatHist $+ $@
features/test.group.cath3: item.cat3 user_sns.ridx test.group
	cpp/mkCatHist $+ $@

features/train.group.uactwcntT features/train.group.uactwperT: train.group user.actwk
	pypy python/mkUActWCnt.py user.actwk train.group
features/test.group.uactwcntT features/test.group.uactwperT: test.group user.actwk
	pypy python/mkUActWCnt.py user.actwk test.group

features/train.group.uapm60r5T: train.group user.apm60
	pypy python/mkUAPM.py user.apm60 train.group 5
features/test.group.uapm60r5T: test.group user.apm60
	pypy python/mkUAPM.py user.apm60 test.group 5

features/train.group.ugenderT features/train.group.uageT features/train.group.utweetsT: train.group 
	pypy python/mkUProfT.py user_profile.ridx train.group
features/test.group.ugenderT features/test.group.uageT features/test.group.utweetsT: test.group 
	pypy python/mkUProfT.py user_profile.ridx test.group


features/train.group.ufollowT: user.stats train.group
	pypy python/mkUFollowT.py  user.stats train.group

features/test.group.ufollowT: user.stats test.group
	pypy python/mkUFollowT.py user.stats test.group

features/train.group.timestampT:train.group
	pypy python/mkTimestamp.py train.group features/train.group.timestampT

features/test.group.timestampT:test.group
	pypy python/mkTimestamp.py test.group features/test.group.timestampT

features/train.group.acnext600T:train.group
	cpp/mkAcntNext train.group features/train.group.acnext600T 600
features/test.group.acnext600T:test.group
	cpp/mkAcntNext test.group features/test.group.acnext600T 600

features/train.group.sdprev2T:train.group
	cpp/mkSessionPrev train.group features/train.group.sdprev2T 2
features/test.group.sdprev2T:test.group
	cpp/mkSessionPrev test.group features/test.group.sdprev2T 2

features/train.group.sdnext4T:train.group
	cpp/mkSessionNext train.group features/train.group.sdnext4T 4
features/test.group.sdnext4T:test.group
	cpp/mkSessionNext test.group features/test.group.sdnext4T 4

features/train.group.sdprev2gT: features/train.group.sdprev2T
	cpp/transSessionGap $+ $@ 0
features/test.group.sdprev2gT: features/test.group.sdprev2T
	cpp/transSessionGap $+ $@ 0

features/train.group.sdnext4gT: features/train.group.sdnext4T
	cpp/transSessionGap $+ $@ 0
features/test.group.sdnext4gT: features/test.group.sdnext4T
	cpp/transSessionGap $+ $@ 0

features/train.group.iRKDX37: run/6.uprofx62.star2000.uproftag.uaction.sns_train.ukey.imfb.icat.h24.reg.decay/train.pred.37 train.purge.group.filter
	pypy python/mkGroupPred.py $+ $@
features/test.group.iRKDX37: run/6.uprofx62.star2000.uproftag.uaction.sns_train.ukey.imfb.icat.h24.reg.decay/test.pred.37 test.purge.group.filter
	pypy python/mkGroupPred.py $+ $@

features/train.group.RKDX.T.uptmtgapct4.f5.r15: run/7.RKDX.T.uprof.tm.uact.cath23.tagx1.lambda.1/train.pred.15 train.purge.group.filter
	pypy python/mkGroupPred.py $+ $@

features/test.group.RKDX.T.uptmtgapct4.f5.r15: run/7.RKDX.T.uprof.tm.uact.cath23.tagx1.lambda.1/test.pred.15 test.purge.group.filter
	pypy python/mkGroupPred.py $+ $@

